<script>
$(document).ready(function(){
  var fid = $(&quot;.movContainer tr:first&quot;).attr(&#39;id&#39;);
  var lid = $(&quot;.movContainer tr:last&quot;).attr(&#39;id&#39;);
  
 $(&quot;.tdPlay&quot;).hover(function() {
  $(&quot;.tdHover&quot;).removeClass(&#39;tdHover&#39;);
  $(this).addClass(&#39;tdHover&#39;);
 })

// click song row 
  $(&quot;.tdPlay&quot;).click(function(){
  $(&quot;.playing&quot;).removeClass(&quot;playing&quot;);;
  $(this).addClass(&quot;playing&quot;);
    var sid = $(this).attr(&#39;id&#39;);
 if (fid != sid) { 
  $(&quot;.btnPrev&quot;).removeAttr(&#39;disabled&#39;);
  $(&quot;.btnFirst&quot;).removeAttr(&#39;disabled&#39;);
 } else
 {
  $(&#39;.btnPrev&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&#39;.btnFirst&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
 }
 if (lid != sid) { 
  $(&quot;.btnNext&quot;).removeAttr(&#39;disabled&#39;);
  $(&quot;.btnLast&quot;).removeAttr(&#39;disabled&#39;);
 } else
 {
  $(&#39;.btnNext&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&#39;.btnLast&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
 }

 var pathstring = &quot;https://docs.google.com/file/d/&quot;+sid+&quot;/preview&quot;;
    $(&quot;.googlePlay&quot;).html(&quot;<iframe allowfullscreen='' height='400' src='&quot;+pathstring+&quot;' width='100%'/>&quot;
    )
  });
  
  // button previous
  $(&quot;.btnPrev&quot;).click(function() {
   var prid = $(&quot;.playing&quot;).prev(&quot;tr&quot;).attr(&quot;id&quot;);
   $(&quot;.playing&quot;).removeClass(&quot;playing&quot;)
   $(&quot;#&quot;+prid).addClass(&quot;playing&quot;);
   var pathstring = &quot;https://docs.google.com/file/d/&quot;+prid+&quot;/preview&quot;;
    $(&quot;.googlePlay&quot;).html(&quot;<iframe allowfullscreen='' height='400' src='&quot;+pathstring+&quot;' width='100%'/>&quot;)
  if (prid == fid) { 
  $(this).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&#39;.btnFirst&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
   } 
    $(&quot;.btnNext&quot;).removeAttr(&#39;disabled&#39;);
  $(&quot;.btnLast&quot;).removeAttr(&#39;disabled&#39;);
 });
 
   //  button first
  $(&quot;.btnFirst&quot;).click(function() {
   $(&quot;.playing&quot;).removeClass(&quot;playing&quot;)
   $(&quot;#&quot;+fid).addClass(&quot;playing&quot;);
   var pathstring = &quot;https://docs.google.com/file/d/&quot;+fid+&quot;/preview&quot;;
  $(&quot;.googlePlay&quot;).html(&quot;<iframe allowfullscreen='' height='400' src='&quot;+pathstring+&quot;' width='100%'/>&quot;)
  // disable first and prev button
  $(&#39;.btnPrev&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&#39;.btnFirst&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&quot;.btnNext&quot;).removeAttr(&#39;disabled&#39;);
  $(&quot;.btnLast&quot;).removeAttr(&#39;disabled&#39;);
 });
 
 // next song
 $(&quot;.btnNext&quot;).click(function() {
    var nxid = $(&quot;.playing&quot;).next(&quot;tr&quot;).attr(&quot;id&quot;);
    $(&quot;.playing&quot;).removeClass(&quot;playing&quot;)
    $(&quot;#&quot;+nxid).addClass(&quot;playing&quot;);
    var pathstring = &quot;https://docs.google.com/file/d/&quot;+nxid+&quot;/preview&quot;;
  $(&quot;.googlePlay&quot;).html(&quot;<iframe allowfullscreen='' height='400' src='&quot;+pathstring+&quot;' width='100%'/>&quot;)
   if (nxid == lid) { 
   $(this).attr(&#39;disabled&#39;, &#39;disabled&#39;);
   $(&#39;.btnLast&#39;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
    } 
     $(&quot;.btnPrev&quot;).removeAttr(&#39;disabled&#39;);
   $(&quot;.btnFirst&quot;).removeAttr(&#39;disabled&#39;);
 });
 
 // last song
 $(&quot;.btnLast&quot;).click(function() {
   $(&quot;.playing&quot;).removeClass(&quot;playing&quot;)
   $(&quot;#&quot;+lid).addClass(&quot;playing&quot;);
   var pathstring = &quot;https://docs.google.com/file/d/&quot;+lid+&quot;/preview&quot;;
  $(&quot;.googlePlay&quot;).html(&quot;<iframe allowfullscreen='' height='400' src='&quot;+pathstring+&quot;' width='100%'/>&quot;)
  // disable next and last button
  $(&#39;.btnPrev&#39;).removeAttr(&#39;disabled&#39;);
  $(&#39;.btnFirst&#39;).removeAttr(&#39;disabled&#39;);
  $(&quot;.btnNext&quot;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  $(&quot;.btnLast&quot;).attr(&#39;disabled&#39;, &#39;disabled&#39;);
  
 });
 
});
</script>
<!--googleplayer-->